// Question database
const questionDatabase = [
    // Math Questions
    {
        id: 1,
        type: 'single',
        subject: 'math',
        question: '计算：3 + 5 × 2 = ?',
        options: ['11', '13', '16', '10'],
        correctAnswer: 1,
        explanation: '根据运算顺序，先算乘法再算加法：3 + 5 × 2 = 3 + 10 = 13'
    },
    {
        id: 2,
        type: 'multiple',
        subject: 'math',
        question: '下列哪些数是质数？',
        options: ['2', '4', '7', '9'],
        correctAnswer: [0, 2],
        explanation: '质数是只能被1和自身整除的大于1的自然数。2和7是质数，4=2×2，9=3×3，都不是质数。'
    },
    {
        id: 3,
        type: 'judge',
        subject: 'math',
        question: '圆的面积公式是 π × r²',
        options: ['正确', '错误'],
        correctAnswer: 0,
        explanation: '圆的面积公式确实是 π × r²，其中r是圆的半径。'
    },
    {
        id: 4,
        type: 'single',
        subject: 'math',
        question: '一个三角形的内角和是多少度？',
        options: ['90°', '180°', '270°', '360°'],
        correctAnswer: 1,
        explanation: '任何三角形的内角和都是180°，这是几何学的基本定理。'
    },
    {
        id: 5,
        type: 'multiple',
        subject: 'math',
        question: '下列哪些是偶数？',
        options: ['6', '7', '8', '9'],
        correctAnswer: [0, 2],
        explanation: '偶数是能被2整除的整数。6和8都能被2整除，所以是偶数。'
    },

    // Chinese Questions
    {
        id: 6,
        type: 'single',
        subject: 'chinese',
        question: '"春眠不觉晓"的下一句是？',
        options: ['处处闻啼鸟', '夜来风雨声', '花落知多少', '红掌拨清波'],
        correctAnswer: 0,
        explanation: '这是孟浩然《春晓》中的诗句："春眠不觉晓，处处闻啼鸟。"'
    },
    {
        id: 7,
        type: 'judge',
        subject: 'chinese',
        question: '"桃花潭水深千尺，不及汪伦送我情"出自李白的诗。',
        options: ['正确', '错误'],
        correctAnswer: 0,
        explanation: '这句诗出自李白的《赠汪伦》，表达了诗人对友人汪伦的深厚情谊。'
    },
    {
        id: 8,
        type: 'multiple',
        subject: 'chinese',
        question: '下列哪些是唐代诗人？',
        options: ['李白', '苏轼', '杜甫', '辛弃疾'],
        correctAnswer: [0, 2],
        explanation: '李白和杜甫都是唐代著名诗人。苏轼是宋代诗人，辛弃疾是宋代词人。'
    },

    // English Questions
    {
        id: 9,
        type: 'single',
        subject: 'english',
        question: 'What is the past tense of "go"?',
        options: ['goed', 'went', 'gone', 'going'],
        correctAnswer: 1,
        explanation: '"Go"的过去式是"went"，这是一个不规则动词变化。'
    },
    {
        id: 10,
        type: 'judge',
        subject: 'english',
        question: '"Apple" is a countable noun.',
        options: ['True', 'False'],
        correctAnswer: 0,
        explanation: '"Apple"（苹果）是可数名词，可以用复数形式"apples"。'
    },
    {
        id: 11,
        type: 'multiple',
        subject: 'english',
        question: 'Which of the following are fruits?',
        options: ['Apple', 'Carrot', 'Banana', 'Potato'],
        correctAnswer: [0, 2],
        explanation: 'Apple（苹果）和Banana（香蕉）是水果。Carrot（胡萝卜）和Potato（土豆）是蔬菜。'
    },

    // Science Questions
    {
        id: 12,
        type: 'single',
        subject: 'science',
        question: '水的化学分子式是什么？',
        options: ['H2O', 'CO2', 'NaCl', 'O2'],
        correctAnswer: 0,
        explanation: '水的化学分子式是H2O，表示一个水分子由两个氢原子和一个氧原子组成。'
    },
    {
        id: 13,
        type: 'judge',
        subject: 'science',
        question: '光的传播速度在真空中约为30万公里每秒。',
        options: ['正确', '错误'],
        correctAnswer: 0,
        explanation: '光在真空中的传播速度约为299,792,458米每秒，约等于30万公里每秒。'
    },
    {
        id: 14,
        type: 'multiple',
        subject: 'science',
        question: '下列哪些是可再生能源？',
        options: ['太阳能', '煤炭', '风能', '石油'],
        correctAnswer: [0, 2],
        explanation: '太阳能和风能都是可再生能源，可以持续利用。煤炭和石油是化石燃料，属于不可再生能源。'
    },
    {
        id: 15,
        type: 'single',
        subject: 'science',
        question: '人体最大的器官是什么？',
        options: ['心脏', '肝脏', '皮肤', '肺'],
        correctAnswer: 2,
        explanation: '皮肤是人体最大的器官，覆盖整个身体表面，具有保护、调节体温等重要功能。'
    }
];

// Export for use in other files
if (typeof module !== 'undefined' && module.exports) {
    module.exports = questionDatabase;
}